<?php

class Default_Model_Game extends Zend_Db_Table_Abstract
{
    protected $_name = 'game';
    public function getDataById($gameId){
    	$query = $this->select()
                        ->from($this->_name)
                        ->where('gameId = ?',$gameId);
        return $this->fetchRow($query);
    }
    public function getDataByGameList($gameList){
        $query = $this->select()
                        ->setIntegrityCheck(false)
                        ->from(array('g'=>$this->_name))
                        ->joinLeft(array('c'=>'categories'),'g.catId = c.catId',array('parentId'))
                        ->where('g.gameId IN '.$gameList)
                        ->where('g.status = ?',1)
                        ->order('g.level DESC')
                        ->order('g.gameId ASC');
        return $this->fetchAll($query);
    }

}